package com.bit.aop.proxy;

/**
 * 代理类
 */
public class HouseProxy implements HouseSubject{
    private HouseSubject realHouseSubject;

    public HouseProxy(HouseSubject realHouseSubject) {
        this.realHouseSubject = realHouseSubject;
    }

    @Override
    public void saleHouse() {
        System.out.println("我是中介, 我帮房东开始代理");
        realHouseSubject.saleHouse();
        System.out.println("我是中介, 我帮房东结束代理");
    }

    @Override
    public void rentHouse() {
        System.out.println("我是中介, 我帮房东开始代理");
        realHouseSubject.rentHouse();
        System.out.println("我是中介, 我帮房东结束代理");
    }
}
